﻿/******************************************************************************************************
Copyright (c) 2014 Steven Giacomelli (stevegiacomelli@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************************************/

namespace SharpGeo.IO.ShapeFiles
{
    /// <summary>
    /// Specifies DBase Field Type (information from http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm)
    /// </summary>
    public enum DBaseFieldType
    {
        /// <summary>
        /// An unknown field type
        /// </summary>
        Unknown = -1,

        /// <summary>
        /// 'B' - 10 digits representing a .DBT block number. The number is stored as a string, right justified and padded with blanks.
        /// </summary>
        Binary,

        /// <summary>
        /// 'C' - All OEM code page characters - padded with blanks to the width of the field.
        /// </summary>
        Character,

        /// <summary>
        /// 'D' - 8 bytes - date stored as a string in the format YYYYMMDD.
        /// </summary>
        Date,

        /// <summary>
        /// 'N' - Number stored as a string, right justified, and padded with blanks to the width of the field.
        /// </summary>
        Numeric,

        /// <summary>
        /// 'L' - 1 byte - initialized to 0x20 (space) otherwise T or F.
        /// </summary>
        Logical,

        /// <summary>
        /// 'M' - a string	10 digits (bytes) representing a .DBT block number. The number is stored as a string, right justified and padded with blanks.
        /// </summary>
        Memo,

        /// <summary>
        /// '@' - 8 bytes - two longs, first for date, second for time.  The date is the number of days since  01/01/4713 BC. Time is hours * 3600000L + minutes * 60000L + Seconds * 1000L
        /// </summary>
        Timestamp,

        /// <summary>
        /// 'I' - 4 bytes. Leftmost bit used to indicate sign, 0 negative.
        /// </summary>
        Long,

        /// <summary>
        /// '+' - Same as Long
        /// </summary>
        AutoIncrement,

        /// <summary>
        /// 'F' - Number stored as a string, right justified, and padded with blanks to the width of the field.
        /// </summary>
        Float,

        /// <summary>
        /// 'O' - 8 bytes - no conversions, stored as a double.
        /// </summary>
        Double,

        /// <summary>
        /// 'G' - 10 digits (bytes) representing a .DBT block number. The number is stored as a string, right justified and padded with blanks.
        /// </summary>
        OleData,
    }
}